import { createApp } from 'vue'
import './assets/css/initApp.css'
import Router from './router'
import Store from './store'
import App from './App.vue'
import { requestInstanceOne } from '@/service/request/index'
function setupApp() {
  const app = createApp(App)
  app.use(Router)
  app.use(Store)
  app.mount('#app')
}

setupApp()
// const abc = 123

console.log('23')
// console.log(nameanc)

interface IApiRes {
  state: string
  errmsg: string
  errcode: string
  errstack: string
  data: any
}
requestInstanceOne
  .request<IApiRes>({
    method: 'DELETE',
    url: '/user/batchDel',
    data: {
      IDs: '9d25d14c-28b0-49c3-8b1c-acc581b63639,ae78fad3-3d2b-46cf-a3e2-ceef8e69f3dc'
    },
    headers: {
      Authorization: 'Bearer '
    },
    interceptors: {
      requestInterceptors(config) {
        console.log('单独请求的 请求拦截器')

        return config
      },
      responseInterceptors(res) {
        console.log('单独请求的 响应拦截器')

        return res
      }
    }
  })
  .then(
    (res) => {
      // 这样就有 类型提示了
      console.log('接口的then 成功', res)
    },
    (err) => {
      console.log('接口的then 失败', err)
    }
  )
